<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Linux 安全权限管理完全指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        /* Hero Section Styles */
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            position: relative;
            overflow: hidden;
        }
        
        .hero-pattern {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
        }
        
        /* Typography */
        h1 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 700;
        }
        
        h2 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
            position: relative;
            padding-left: 1rem;
        }
        
        h2::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 70%;
            background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        /* Code Block Styles */
        pre {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 12px;
            padding: 1.5rem;
            overflow-x: auto;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            position: relative;
            font-family: 'Consolas', 'Monaco', monospace;
        }
        
        pre::before {
            content: attr(data-language);
            position: absolute;
            top: 0.5rem;
            right: 1rem;
            font-size: 0.75rem;
            color: #858585;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        
        /* Card Styles */
        .content-card {
            background: white;
            border-radius: 16px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        
        .content-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
        }
        
        .content-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
        }
        
        /* Feature Box */
        .feature-box {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            border-radius: 12px;
            padding: 1.5rem;
            border: 1px solid rgba(102, 126, 234, 0.1);
            transition: all 0.3s ease;
        }
        
        .feature-box:hover {
            background: linear-gradient(135deg, #e9ecef 0%, #b8c6db 100%);
            border-color: rgba(102, 126, 234, 0.3);
        }
        
        /* Table Styles */
        table {
            border-collapse: separate;
            border-spacing: 0;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        }
        
        th {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-weight: 600;
            text-align: left;
            padding: 1rem 1.5rem;
        }
        
        td {
            background: white;
            padding: 1rem 1.5rem;
            border-bottom: 1px solid #e5e7eb;
        }
        
        tr:last-child td {
            border-bottom: none;
        }
        
        /* Icon Styles */
        .icon-wrapper {
            width: 48px;
            height: 48px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.25rem;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }
        
        /* Mermaid Diagram Container */
        .mermaid-container {
            background: white;
            border-radius: 16px;
            padding: 2rem;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            margin: 2rem 0;
        }
        
        /* Highlight Box */
        .highlight-box {
            background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
            border-radius: 12px;
            padding: 1.5rem;
            margin: 1.5rem 0;
            position: relative;
            overflow: hidden;
        }
        
        .highlight-box::before {
            content: '\f0eb';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            font-size: 3rem;
            opacity: 0.1;
        }
        
        /* Animation */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .animate-fade-in {
            animation: fadeInUp 0.6s ease-out;
        }
        
        /* Responsive */
        @media (max-width: 768px) {
            .hero-gradient {
                padding: 3rem 1rem;
            }
            
            h1 {
                font-size: 2rem;
            }
            
            .content-card {
                margin: 1rem;
            }
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 relative">
        <div class="hero-pattern"></div>
        <div class="container mx-auto px-4 relative z-10">
            <div class="max-w-4xl mx-auto text-center animate-fade-in">
                <div class="flex justify-center mb-6">
                    <div class="icon-wrapper" style="width: 80px; height: 80px; font-size: 2rem;">
                        <i class="fas fa-shield-alt"></i>
                    </div>
                </div>
                <h1 class="text-5xl mb-6">Linux 安全权限管理完全指南</h1>
                <p class="text-xl opacity-90 leading-relaxed">
                    深入掌握 Linux 系统的三大安全支柱：权限管理、SELinux 和防火墙配置
                </p>
                <div class="mt-8 flex justify-center space-x-4">
                    <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                        <i class="fas fa-clock mr-2"></i>阅读时间：15分钟
                    </span>
                    <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                        <i class="fas fa-layer-group mr-2"></i>企业级实战
                    </span>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto px-4 py-12 max-w-6xl">
        <!-- Introduction Card -->
        <div class="content-card p-8 mb-8 animate-fade-in">
            <div class="flex items-start space-x-4">
                <div class="icon-wrapper">
                    <i class="fas fa-info-circle"></i>
                </div>
                <div class="flex-1">
                    <h3 class="text-2xl font-semibold mb-3">为什么需要掌握 Linux 安全？</h3>
                    <p class="text-gray-700 leading-relaxed">
                        在现代企业环境中，Linux 系统承载着关键业务应用。一个配置不当的权限设置可能导致数据泄露，
                        一个错误的防火墙规则可能让系统暴露在攻击之下。本指南将带你系统掌握 Linux 安全的核心技术，
                        通过实战案例让你成为企业安全的守护者。
                    </p>
                </div>
            </div>
        </div>

        <!-- Section 1: 权限管理基础 -->
        <section class="mb-12">
            <h2 class="text-3xl mb-6">一、权限管理基础：文件系统的钥匙系统</h2>
            
            <div class="content-card p-8 mb-6">
                <h3 class="text-xl font-semibold mb-4 flex items-center">
                    <i class="fas fa-key text-purple-600 mr-3"></i>
                    1.1 三位一体的权限模型
                </h3>
                
                <p class="text-gray-700 mb-4">Linux权限系统如同保险箱的三位密码锁：</p>
                
                <div class="grid md:grid-cols-3 gap-4 mb-6">
                    <div class="feature-box">
                        <div class="flex items-center mb-2">
                            <i class="fas fa-user text-purple-600 mr-2"></i>
                            <strong>用户权限（User）</strong>
                        </div>
                        <p class="text-gray-600">文件所有者的专属权限</p>
                    </div>
                    <div class="feature-box">
                        <div class="flex items-center mb-2">
                            <i class="fas fa-users text-purple-600 mr-2"></i>
                            <strong>组权限（Group）</strong>
                        </div>
                        <p class="text-gray-600">所属用户组的共享权限</p>
                    </div>
                    <div class="feature-box">
                        <div class="flex items-center mb-2">
                            <i class="fas fa-globe text-purple-600 mr-2"></i>
                            <strong>其他用户（Others）</strong>
                        </div>
                        <p class="text-gray-600">系统中其他所有人的权限</p>
                    </div>
                </div>
                
                <p class="text-gray-700 mb-3">查看权限的典型输出：</p>
                <pre data-language="bash"><code>$ ls -l webapp.jar
-rwxr-xr-- 1 javaapp devops 15M Sep 1 10:00 webapp.jar</code></pre>
                
                <div class="highlight-box mt-4">
                    <h4 class="font-semibold mb-2">
                        <i class="fas fa-lightbulb mr-2"></i>权限解读说明
                    </h4>
                    <ul class="space-y-1">
                        <li><i class="fas fa-check text-green-600 mr-2"></i>用户：读写执行（rwx）- 完全控制</li>
                        <li><i class="fas fa-check text-green-600 mr-2"></i>组：读执行（r-x）- 可运行但不可修改</li>
                        <li><i class="fas fa-check text-green-600 mr-2"></i>其他：只读（r--）- 仅可查看</li>
                    </ul>
                </div>
            </div>
            
            <div class="content-card p-8">
                <h3 class="text-xl font-semibold mb-4 flex items-center">
                    <i class="fas fa-rocket text-purple-600 mr-3"></i>
                    1.2 权限实战：部署Java应用
                </h3>
                
                <p class="text-gray-700 mb-4">场景：部署Spring Boot应用的常见权限问题</p>
                
                <div class="grid md:grid-cols-2 gap-6">
                    <div class="bg-red-50 border border-red-200